<?xml version="1.0"?>
<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:html="http://www.w3.org/1999/xhtml">
  <atom:id>http://bill.welliver.org/atom/pike/Fins/Getting Started</atom:id>
  <atom:title type="text">electronic.alchemy :: Getting Started</atom:title>
  <atom:updated>2026-05-16T06:36:14-04:00</atom:updated>
  <atom:link href="http://bill.welliver.org/atom/pike/Fins/Getting Started" type="application/atom+xml"></atom:link>
  <atom:link href="http://bill.welliver.org/space/pike/Fins/Getting Started" type="text/html"></atom:link>
  <atom:link href="http://bill.welliver.org/rss/pike/Fins/Getting Started" type="application/rss+xml"></atom:link>
  <atom:generator uri="http://modules.gotpike.org/blahblah/Public.Syndication.ATOM" version="0.1">Public.Syndication.ATOM (Pike v8.0 release 702)</atom:generator>
  <atom:icon>http://bill.welliver.org/favicon.ico</atom:icon>
  <atom:logo>http://bill.welliver.org/static/images/alchemy.gif</atom:logo>
  <atom:subtitle type="xhtml"><html:div xmlns:html="http://www.w3.org/1999/xhtml"><html:b class="bold">Prerequisites</html:b><html:p class="paragraph"/>
Make sure you have the prerequisites (these are mandatory):&#xD;
<html:ul class="minus">
<html:li>Pike v7.8 or newer.</html:li>
<html:li>Public.Tools.ConfigFiles, obtainable from <html:span class="nobr"><html:img height="9" width="8" src="/static/images/Icon-Extlink.png" alt="[external]"/><html:a href="http://modules.gotpike.org">http://modules.gotpike.org</html:a></html:span> or monger (use <html:i class="ital">pike -x monger --install Public.Tools.ConfigFiles</html:i>) This is included in Fins/Win and the Fins-0.9.5 snapshot, but not HG.</html:li>
</html:ul>The following components are optional, but you lose functionality if they're not present:&#xD;
<html:ul class="minus">
<html:li>Database support (either mySQL, SQLite or postgres) compiled in Pike. Without this, you won't be able to use the Model framework.</html:li>
<html:li>Public.Parser.XML2 (and libxml2), available from <html:span class="nobr"><html:img height="9" width="8" src="/static/images/Icon-Extlink.png" alt="[external]"/><html:a href="http://modules.gotpike.org">http://modules.gotpike.org</html:a></html:span> or monger. Without this, you won't be able to use XSLT templating (not the default, so not a real big loss if you don't have it)</html:li>
<html:li>Dojo, available from <html:span class="nobr"><html:img height="9" width="8" src="/static/images/Icon-Extlink.png" alt="[external]"/><html:a href="http://www.dojotoolkit.org">http://www.dojotoolkit.org</html:a></html:span> for client side operations such as AJAX. You'll need to install all of the dojo files (like dojo.js) in your static/javascripts directory.</html:li>
</html:ul><html:b class="bold">Installing</html:b><html:p class="paragraph"/>
You can either download a ready-to-go bundle, Fins-0.9.5, or get the latest code from HG. Fins-0.9.5 is easy because all of the prerequisites are taken care of, you just need to add Fins/lib to your module path and you're in business. The drawback is that the snapshot doesn't include new functionality. The following instructions describe the CVS approach. For details about Fins-0.9.5, see <html:a href="/space/pike/Fins/Windows">Windows</html:a>.<html:p class="paragraph"/>
Once you have the prerequisites installed, you can download a snapshot of Fins from the HG repository at <html:a href="bitbucket" class="wiki_link_external">http://hg.welliver.org/fins</html:a><html:p class="paragraph"/>
Unzip this package, and you should have a Fins directory.<html:p class="paragraph"/>
&#xD;
That's it! You've got everything in place to start working with Fins.<html:p class="paragraph"/>
<html:b class="bold">Do you have any examples? How do I get started?</html:b><html:p class="paragraph"/>
Glad you asked! There are 2 example apps bundled with Fins: HelloWorld and SmugMug. You can install HelloWorld without any additional modules, though SmugMug requires Public.Image.SmugMug and a support module (Public.Parser.XML2). Additionally, you can check out the <html:a href="/space/pike/Fins/Internals">Internals</html:a> page for information about what you need to have in order to create your own Fins app from scratch. Don't worry, it's not that hard, there are only 3 files in a minimum application!<html:p class="paragraph"/>
There are a few sample apps, which you can find at <html:span class="nobr"><html:img height="9" width="8" src="/static/images/Icon-Extlink.png" alt="[external]"/><html:a href="http://hww3.riverweb.com/dist/Fins/samples">http://hww3.riverweb.com/dist/Fins/samples</html:a></html:span> . You'll need the Fins framework in your Pike module path. Simply unpackage and then run a command like:<html:p class="paragraph"/>
<html:div class="code"><html:pre><html:pre>&#xD;
pike -Mlib -x fins start HelloWorld&#xD;
</html:pre></html:pre></html:div><html:p class="paragraph"/>
&#xD;
From there, you can make a copy of the application directory and customize it till your heart's content! It's still helpful to read the <html:a href="/space/pike/Fins/Internals">Internals</html:a> page so that you understand how things work internally.<html:p class="paragraph"/>
<html:b class="bold">Creating your own Application</html:b><html:p class="paragraph"/>
Fins comes with a set of administrative tools that can be used to perform some of the more important tasks when working with Fins applications. Make sure that your PIKE_MODULE_PATH environment variable contains the <html:i class="ital">lib</html:i> directory from the Fins software.<html:p class="paragraph"/>
<html:div class="code"><html:pre><html:pre>&#xD;
pike -x fins command [args]&#xD;
</html:pre></html:pre></html:div><html:p class="paragraph"/>
&#xD;
The most important commands are <html:b class="bold">create</html:b>, __model__ and <html:b class="bold">start</html:b>. They are used to create a new application, work with the database model and run the application, respectively. For example, we can create a new application:<html:p class="paragraph"/>
<html:div class="code"><html:pre><html:pre>&#xD;
bash-2.05$ pike -x fins create myapp&#xD;
17:06:27 INFO - CreateApplication module loading&#xD;
17:06:27 INFO - CreateApplication module running.&#xD;
17:06:27 INFO - Creating application myapp in /opt/work.&#xD;
17:06:27 INFO - Be sure to edit config/*.cfg to specify the application's datasource&#xD;
bash-2.05$ ls myapp&#xD;
bin        classes    config     logs       modules    static     templates&#xD;
</html:pre></html:pre></html:div><html:p class="paragraph"/>
&#xD;
You will notice that there is a bin directory, and this contains a simple script that can be used to run the application, which is particularly useful for development purposes. This script is called <html:i class="ital">start.sh</html:i> on unix boxes and takes a number of optional arguments such as <html:i class="ital"><html:strike class="strike">port</html:strike></html:i> or <html:i class="ital">hilfe</html:i>. You can relocate this directory later if you need to, assuming your application only uses relative paths in its code for files on the filesystem, as long as the Fins module directory (lib) is in your Pike's module path.<html:p class="paragraph"/>
The first thing we should do is edit the configuration file. By default, the configuration file includes a section for the database model, which we've not defined yet. For this reason, we need to comment it out. If we don't the application will fail to load. Simply edit <html:i class="ital">myapp/config/dev.cfg</html:i> and comment out the entire <html:i class="ital">[model]</html:i> section by putting a pound sign (#) at the beginning of each line. Once that's done, save the file.<html:p class="paragraph"/>
Now, we can start up the application. To do this, we'll use the <html:i class="ital">start</html:i> tool:<html:p class="paragraph"/>
<html:div class="code"><html:pre><html:pre>&#xD;
bash-2.05$ pike -Mlib -x fins start myapp&#xD;
23:45:04 INFO - FinServe starting on port 8080&#xD;
23:45:04 INFO - Starting Session Manager.&#xD;
23:45:04 INFO - FinServe loading application myapp using configuration dev&#xD;
23:45:04 INFO - Loading log configuration from /Users/test/Fins/myapp/config/log_dev.cfg, <html:b><html:font color="darkblue">if</html:font></html:b> present.&#xD;
23:45:04 DEBUG - config file: /Users/test/Fins/myapp/config/dev.cfg&#xD;
23:45:04 INFO - Preparing to load application myapp.&#xD;
23:45:04 INFO - Starting Cache.&#xD;
23:45:04 DEBUG - No model defined!&#xD;
23:45:04 DEBUG - /Users/test/Fins/myapp/classes/application()-&gt;load_controller()&#xD;
23:45:04 INFO - Application myapp loaded.&#xD;
23:45:04 INFO - FinServe listening on port 8080&#xD;
23:45:04 INFO - Application ready <html:b><html:font color="darkblue">for</html:font></html:b> business.&#xD;
</html:pre></html:pre></html:div><html:p class="paragraph"/>
&#xD;
If you've followed these instructions correctly, you should be able to point your web browser at port 8080 and get the Fins welcome page.<html:p class="paragraph"/>
<html:b class="bold">Where to go from here</html:b>&#xD;
<html:ul class="minus">
<html:li><html:a href="/space/pike/Fins/Developer/ModelDemo">ModelDemo</html:a>, a step by step demo using the Fins Database Model functionality</html:li>
</html:ul></html:div></atom:subtitle>
</atom:feed>
